package com.yidu.BusinessParament.mapper;


import com.yidu.BusinessParament.entity.SettleMent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @author 苏彬
 * @date 2023/2/8 8:53
 **/
@Mapper
public interface SettleMentMapper {
    @Select("SELECT d.`cashId`,d.`dealId`,d.`dealTime`,d.`dealPrice`,d.`dealNumber`,d.`endMoney`,d.`dealMoney`,d.`endTime`,c.`accountName`,s.`securityName`,b.`brokerName`,d.`dealWay`,d.`dealState` FROM dealData d INNER JOIN cash c ON d.`cashId`=c.`cashId` INNER JOIN SECURITY s ON d.`securityId`=s.`securityId` INNER JOIN broker b ON d.`brokerId`=b.`brokerId` where 1=1  ${term} limit #{page},#{row}")
    List<SettleMent> selectSettleMent(Map map);

    @Update("update dealData SET dealState=#{dealState} WHERE dealId=#{dealId}")
    int updateSettleMent(Map map);
}
